<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
#parse("/linkandscript.html")

<title>Serverpanel</title>
</head>
#parse("/firebasereademb.html")

<body>
<div id="genereatekeydiv" class="section">
key：
<input id="queueid" name="" type="text" value="$targetqueueid" size="32" maxlength="32" />
<input id="key" name="" type="text" value="$targetkey" style="width:400px"/>
<input name="发送" type="button" id="sendkeybtn" value="发送" />
<script>
	$('#sendkeybtn').click(function () {
        var queueid = $("#queueid").val();
		var key = $("#key").val();
		var myDataRef = new Firebase('https://luntankong.firebaseIO.com/keys/');
		var queue = myDataRef.child(queueid);
		queue.set(key);
		$("#queueid").val("");
		$("#key").val("");
      });
</script>
</div>



<div id="generaldiv" class="section">
broadcast：
<input id="childid" name="" type="text" value="broadcast" size="32" maxlength="32" />
<input id="childvalue" name="" type="text" value="这是一条广播" style="width:400px"/>
<input name="发送" type="button" id="sendchildbtn" value="发送" />
<script>
	$('#sendchildbtn').click(function () {
        var childid = $("#childid").val();
		var childvalue = $("#childvalue").val();
		var myDataRef = new Firebase('https://luntankong.firebaseIO.com/');
		var child = myDataRef.child(childid);
		child.set(childvalue);
		$("#childid").val("");
		$("#childvalue").val("");
      });
</script>
</div>



<div id="set site div" class="section">
site url：
<input id="childid1" name="" type="text" value="av" size="32" maxlength="32" />
<textarea id="childvalue1" cols="" rows="5" style="width:800px">
{"id":"av","name":"爱唯","domain":"tk.avzca.info","urlp":"http://DOMAIN/bbs/forumdisplay.php?fid=FORUMCODE&filter=0&orderby=dateline&page=PAGEINDEX","trp":"form tr","titlep":"td.f_title a","contentp":"table.t_msg","needproxy":false}
</textarea>
<input name="发送" type="button" id="sendchildbtn1" value="发送" />
<script>
	$('#sendchildbtn1').click(function () {
        var childid = $("#childid1").val();
		var childvalue = $("#childvalue1").val();
		var childjson = JSON.parse(childvalue);
		var myDataRef = new Firebase('https://luntankong.firebaseIO.com/sites/');
		var child = myDataRef.child(childid);
		child.set(childjson);
		$("#childid1").val("");
		$("#childvalue1").val("");
      });
</script>
</div>



<div id="createforum" class="section">
	#parse("/createforum.html")
</div>



</body>
<script language="javascript">
$(function(){
	
	
	
	$("#settingsdiv input").blur(function(){
		id = $(this).attr("id");
		newvalue = $(this).val();
		oldvalue = $(this).attr("oldvalue");
		
		if(oldvalue != newvalue){
			$(this).attr("oldvalue",newvalue);
			console.log(id + ":" + name + ":" +  oldvalue + "->" + newvalue);
			
			$.post('/hezi/setting?action=update',{id: id, 
								newvalue:newvalue,
								},function(theback)
			  {
				console.log("back:" + theback);
				}
			);
			
		}
		
	});
	
})

</script>
<style type="text/css">
.right{
	text-align:right;
}
#settingsdiv{
	border:0px #006 solid;
	width:996px;
	font-size:16px;
}
#settingsdiv td{
	padding:2px 10px;
	vertical-align: middle;
}
#settingsdiv input{
	margin-top:8px;
	padding:2px;
}



.section{
	margin: 20px;
	border-bottom:#333 1px dotted;
}




</style>
</html>
